package com.example.whatrubbish.model;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

public class ReceiverAddress implements Serializable {
    private Long id;

    @Valid
    @NotNull(message = "地址不能为空")
    private String address;

    @NotBlank
    private String userId;

    @Valid
    @NotBlank(message = "手机号码不能为空")
    private String phone;

    @Valid
    @NotBlank(message = "收件人不能为空")
    private String name;

    private Date createTime;

    private Integer isDefault;

    public ReceiverAddress(Long id, String address, String userId, String phone, String name, Date createTime, Integer isDefault) {
        this.id = id;
        this.address = address;
        this.userId = userId;
        this.phone = phone;
        this.name = name;
        this.createTime = createTime;
        this.isDefault = isDefault;
    }

    public ReceiverAddress() {
        super();
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address == null ? null : address.trim();
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId == null ? null : userId.trim();
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone == null ? null : phone.trim();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getIsDefault() {
        return isDefault;
    }

    public void setIsDefault(Integer isDefault) {
        this.isDefault = isDefault;
    }
}